In order for the Chapter 6 examples to run, you must have the QuickDraw GX extension in the Extensions folder of your Mac's System Folder. QuickDraw GX is a part of System 7.5. If you installed System 7.5, but didn't install QuickDraw GX, use your install disks to add it to your system.
Notice that the QuickDraw GX header files that are included in a project are nested between #pragmas. You need to place the header files between these pragmas. The following is an example. If you want an explanation, read on. If you don't want an explanation, that's okay. But you still _need_ to use these #pragmas in your code!
#ifndef powerc
#pragma pointers_in_D0
#endif
#include "PrintingManager.h"
#include "graphics macintosh.h"
#include "graphics libraries.h"
#ifndef powerc
#pragma pointers_in_A0
#endif
The #ifndef powerc means "if the constant powerc is _not_ defined, execute the following code." The "following code" is the #pragma directive. The effect is that when compiling with the 68K compiler, the #pragma statements will be executed. When compiling with the PowerPC compiler, the #pragma statements won't be executed.
Why does QuickDraw GX code compiled with a Metrowerks 68K compiler need these two #pragmas? These two #pragmas let you choose between two calling conventions. QuickDraw GX Toolbox functions normally return pointers in the D0 register. Metrowerks uses a convention that returns pointers in the A0 register. By using pointers_in_D0, you tell the 68K compiler to do things "the Toolbox way" for the routines listed in the #include files. After the #include files are listed, the second #pragma (pointers_in_A0) tells the 68K compiler to go back to doing things "the Metrowerks way."